
from xhs_tcp import CookieApp, XhsTcp
from Request import Request

def main():
    # request_obj = Request(remote_computer_name)
    """
    deviceId=24bb0a68-2db0-316a-9e89-e1e2aaac3ab7
    &identifier_flag=2
    &tz=Asia%2FShanghai
    &fid=16258205851061c9a07c83df8573f3faa1395850b64d
    &app_id=ECFAAF01
    &device_fingerprint1=20210510211900f2da2123f42474ae30f8a1ae10949c6701400205750c5796
    &uis=light
    &launch_id=1625820691
    &project_id=ECFAAF
    &device_fingerprint=20210510211900f2da2123f42474ae30f8a1ae10949c6701400205750c5796
    &versionName=6.95.0
    &platform=android
    &sid=session.1625820725637916609985&t=1625821020&build=6950211&x_trace_page_current=explore_feed&lang=zh-Hans&channel=YingYongBao
    https://www.xiaohongshu.com/user/profile/60e7f7b2000000000100064b?xhsshare=CopyLink&appuid=60e7f7b2000000000100064b&apptime=1625821302
    userid=60e95542000000002002c1a5
    """


    userid = "60d7c28e00000000010003a3"
    # sid = "session.1626938912234284330673"https://www.xiaohongshu.com/user/profile/60e95542000000002002c1a5?xhsshare=CopyLink&appuid=60e95542000000002002c1a5&apptime=1627031692
    # device_id = "103f20c5-12ef-4b0b-b583-9b7116dc0d9c"
    # smid = "202107221528295c30c18f2e67e01462c1765eaf081f5201fd932ae534d59c"

    # xy-common-params: deviceId=945771d9-6d46-3a0b-bff7-62224e79f767&identifier_flag=2&tz=Asia%2FShanghai&fid=162701307510d7a7507a293cab050b53318f35b71d1a&app_id=ECFAAF01&device_fingerprint1=202107101522494b5a757e17110e860d6de86e2c15822f01b42f06e8730b88&uis=light&launch_id=1627014454&project_id=ECFAAF&device_fingerprint=202107101522494b5a757e17110e860d6de86e2c15822f01b42f06e8730b88&versionName=6.90.0.1&platform=android&sid=session.1627014581672614155389&t=1627021147&build=6900179&x_trace_page_current=message_home_page&lang=zh-Hans&channel=PMgdt19935739
    # device_data = {"device_id": "e3cce94d-9171-4372-b676-75d631f31b00", "smid": "202107231709512008c6e7f5c6492abcb1d9aac2164ef301a5ba2006c9deb5", "sid": "session.1627031392932862792302", "fid": "16270313861051568a18ef511af80e7c7669b772a5f2", "register_time": "1627031393"}
    device_data = {"device_id": "eea5f481-47ce-387b-87f3-fd6157295e56", "smid": "20210731111930af79906440e6000c8868c36d39877b67005f1813afaddd92", "device_fingerprint1": "2021073111193483df1bc169bb1c0f354d6999c9f041d901f7103cbda7de56", "device_fingerprint": "20210731111930af79906440e6000c8868c36d39877b67005f1813afaddd92", "sid": "session.1627701659307701709291", "fid": "162770157010053041ac0b953c44d5c349c7c02b42c8", "register_time": "2021-06-27 08:13:02"}
    to_userid = "5a1ce5284eacab6fec2ca38b"
    # msg = "集美 我这边是长期需要小红书博主，主要做图文直发， 请问你这边接吗，可付费合作，如果接的+❤： gx64445"
    msg = "亲 ,合作 吗,+ ❤ crazy_acong"
    # task_id = task_data['task_id']
    cookie_app_obj = CookieApp(userid, device_data['sid'], device_data['device_id'], device_data['smid'], to_userid, msg)
    obj = XhsTcp(cookie_app_obj, "send")
    if obj.user_auth and obj.ok8:
        print("发送成功")
        # request_obj.post_message_task(task_id)


if __name__ == '__main__':
    main()